import request from 'UTIL/request'

// 审批类型列表
export function ExamineCategoryList(data) {
  return request({
    url: 'oaExamineCategory/queryAllExamineCategoryList',
    method: 'POST',
    data: data
  })
}

// 我发起的审批
export function MyInitiate(data) {
  return request({
    url: 'oaExamine/myInitiate',
    method: 'POST',
    data: data,
    hideLoading: true
  })
}

// 我审批的
export function WaitingQueryOaExamineList(data) {
  return request({
    url: 'examineWaiting/queryOaExamineList',
    method: 'POST',
    data: data,
    hideLoading: true
  })
}

// 查询审批详情
export function QueryExamineInfo(data) {
  return request({
    url: `oaExamine/queryOaExamineInfo/${data.examineId}`,
    method: 'POST'
  })
}

// 审批新建
export function SetOaExamine(data) {
  return request({
    url: 'oaExamine/setOaExamine',
    method: 'POST',
    data: data
  })
}

// 审批删除
export function DeleteOaExamine(data) {
  return request({
    url: 'oaExamine/deleteOaExamine',
    method: 'POST',
    data: data,
    requestType: 'form'
  })
}

// 审批
export function AuditExamine(data) {
  return request({
    url: 'oaExamine/auditExamine',
    method: 'POST',
    data: data
  })
}

// 获取审批流
export function QueryStepById(data) {
  return request({
    url: 'oaExamine/queryExaminStep',
    method: 'POST',
    data: data,
		requestType: 'form'
  })
}

// 根据审核记录id，查询审核步骤和审核记录
export function QueryExamineRecordList(data) {
  return request({
    url: 'oaExamine/queryExamineRecordList',
    method: 'POST',
    data: data,
		requestType: 'form'
  })
}

// 根据审核记录id，查询审核历史
export function QueryExamineLogList(data) {
  return request({
    url: 'oaExamine/queryExamineLogList',
    method: 'POST',
    data: data,
		requestType: 'form'
  })
}

// 查询详情或编辑字段
export function GetField(data) {
  return request({
    url: 'oaExamine/getField',
    method: 'POST',
    data: data
  })
}

// 查询新增或编辑字段
export function QueryField(data) {
  return request({
    url: `oaExamineField/queryField/${data.examineId}`,
    method: 'POST',
		data: data,
		requestType: 'form'
  })
}
